//
// Created by apple on 2021/5/28.
//

#ifndef LEARN_BREADTH_FIRST_SEARCH_H
#define LEARN_BREADTH_FIRST_SEARCH_H
#include <iostream>
#include "list"
using namespace std;


class Graph {
private:
    int V;
    list<int>* adj;

public:
    Graph(int vertex){
        this->V = vertex;
        adj = new std::list<int> [vertex];   // init adjacency list
    };
    ~Graph(){
        delete [] adj;  // need [] attention!
        adj = nullptr;
    };
    void addEdge(int v, int w){
        adj[v].push_back(w);
    };
};





#endif //LEARN_BREADTH_FIRST_SEARCH_H
